<tal:block metal:define-macro="service_detail">
  <table>
    <tr style="background-color:#e3e3e3; font-weight: bold;">
      <td colspan="3">
        ${detail/label}
        <span style="float:right">
          <a type="button" aria-label="Left Align" class="btn btn-default glyphicon glyphicon-edit" aria-hidden="true" tal:condition="php:_SESSION['admin'] == True' | NULL" href="${getPath}/monitor/service/edit/${detail/server_id}" />
          <a type="button" aria-label="Left Align" class="btn btn-default glyphicon glyphicon-briefcase" aria-hidden="true" title="${text/monitor_overview_show_systemdetails | NULL}" href="/server/detail/${detail/home_system | NULL}" />
        </span>
      </td>
    </tr>

    <tr>
      <td style="width:33%;">${text/inventory_hardware_designation | NULL}: ${detail/label}</td>
      <td style="width:33%;">${detail/ip}</td>
      <td style="width:33%;">${text/monitor_service_port | NULL}: ${detail/port}</td>
    </tr>

    <tr>
      <td>${text/structure_system_type | NULL}: ${detail/type}</td>
      <td>${text/monitor_service_searchpattern | NULL}: ${detail/pattern}</td>
      <td>${text/structure_system_status | NULL}: ${detail/status}</td>
    </tr>

    <tr>
      <td>${text/monitor_overview_last_online | NULL}: ${detail/last_online}</td>
      <td>${text/monitior_overview_last_check | NULL}: ${detail/last_check}</td>
      <td>${text/monitor_overview_rtime | NULL}: ${detail/rtime}</td>
    </tr>

    <tr>
      <td>${text/structure_system_monitor | NULL}: ${detail/active}</td>
      <td>${text/structure_system_pushover | NULL}: ${detail/pushover}</td>
      <td>${text/structure_system_email | NULL}: ${detail/email}</td>
    </tr>
    <tr>
      <td colspan="3">${text/inventory_hardware_description | NULL}: ${detail/description}</td>
    </tr>
  </table>
</tal:block>


<tal:block metal:define-macro="service_log">
  <table>
    <tr style="background-color:#e3e3e3; font-weight: bold;">
      <td style="width:15%;">${text/structure_system_type | NULL}</td>
      <td>${text/structure_system_message | NULL}</td>
      <td style="width:15%;">
        <span style="float:right;">
          ${text/structure_system_date_time | NULL} 
          <a type="button" aria-label="Left Align" class="btn btn-default glyphicon glyphicon-trash" aria-hidden="true" href="${getPath}${getURL}/empty" title="${text/empty_logfiles | NULL}" onclick="return confirm('${text/empty_logfiles | NULL}');" />
        </span>
      </td>
    </tr>

    <tr tal:repeat="detail detail/log">
      <td>${detail/type}</td>
      <td>${structure detail/message}</td>
      <td>
        <span style="float:right;">
          ${detail/datetime}
        </span>
      </td>
    </tr>
  </table>
</tal:block>



<tal:block metal:define-macro="service_log_detail">
  <div class="list-group margin-b-3">
    <table >
      <tr style="background-color:#e3e3e3; font-weight: bold;">
        <td style="width:20%;">${text/structure_system_date_time | NULL}</td>
        <td style="width:80%;">${text/structure_system_message | NULL}</td>
      </tr>

      <tr tal:repeat="detail detail/log">
        <td>${detail/datetime}</td>
        <td>${structure detail/message}</td>
      </tr>
    </table>
  </div>
</tal:block>



<tal:block metal:define-macro="service_uptime">
  <div class="list-group margin-b-3">
    <table>
      <tr style="background-color:#e3e3e3; font-weight: bold;">
        <td style="width:200px;">${text/structure_system_date | NULL}</td>
        <td style="width:600px;">${text/monitor_overview_rtime | NULL}</td>
      </tr>

      <tr tal:repeat="uptime server_detail/uptime">
        <td style="width:200px;">${uptime/date}</td>
        <td style="width:600px;">${uptime/latency}</td>
      </tr>        
    </table>
  </div>
</tal:block>



<tal:block metal:define-macro="dns">
  <div class="list-group margin-b-3" tal:condition="server_detail/dns | NULL">
    <table>
      <tr style="background-color:#e3e3e3; font-weight: bold;">
        <td>${text/structure_system_dns_info | NULL}</td>
      </tr>

      <tr tal:condition="server_detail/dns | NULL" tal:repeat="dns server_detail/dns"> 
        <td style="width:800px;">
          <span tal:condition="dns/meldung | NULL">${structure dns/meldung | NULL}<br /></span>

          <span tal:condition="dns/record | NULL">
            <span tal:repeat="record dns/record">
               ${text/structure_system_real_host | NULL} : ${record/host | NULL} - (<a href="${getPath}/inventory/portscan/${record/ip | NULL}">${dns/ip | NULL} - ${text/structure_system_portscan | NULL}</a>)
            </span>
          </span>

          <span tal:condition="not:dns/record | NULL">
              ${text/structure_system_real_host | NULL}: ${dns/hostname | NULL} - (<a href="${getPath}/inventory/portscan/${dns/ip | NULL}">${dns/ip | NULL} - ${text/structure_system_portscan | NULL}</a>)
          </span>
        </td>
      </tr>

    </table>

    <div id="check_container">
      <div id="check_content"></div>
    </div>
  </div>
</tal:block>

